package com.vinoxm.admin.vo;

import lombok.Data;
import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.io.Serializable;
import java.util.Collection;

public class UserVo extends User {

    @Getter
    private ExtraData data;
    @Getter
    private Long id;

    public UserVo(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }

    public UserVo(String username, String password, Collection<? extends GrantedAuthority> authorities,Long id, ExtraData data) {
        super(username, password, authorities);
        this.id = id;
        this.data = data;
    }

    public UserVo(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
    }

    @Data
    public static class ExtraData implements Serializable {
        private String password;
    }
}
